package com.summer.study.leetcode.tree;

/**
 * @auther: 杨杰
 * @date: 2019/7/30 15:04
 * @description:
 */
public final class BinaryTreeNode<E> extends TreeNode<E> {

    private BinaryTreeNode left;

    private BinaryTreeNode right;

    public BinaryTreeNode(E val) {
        this.val = val;
        this.left = null;
        this.right = null;
    }

    public BinaryTreeNode(E val, Node left, Node right) {
        this.val = val;
        this.left = (BinaryTreeNode) left;
        this.right = (BinaryTreeNode) right;
    }

    public BinaryTreeNode getLeft() {
        return left;
    }

    public BinaryTreeNode getRight() {
        return right;
    }

    public void setLeft(BinaryTreeNode left) {
        this.left = left;
    }

    public void setRight(BinaryTreeNode right) {
        this.right = right;
    }

    @Override
    public E getVal() {
        return this.val;
    }
}
